/*
 * @FilePath     : /study_code/routes/layui/tree-table.js
 * @Description  : layui 树表插件，模拟后端返回
 * @Date         : 2025-04-10 17:20:32
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-10 17:32:48
 */
const express = require('express')

const router = express.Router()

// 1、路由模块测试路由
router.get('/', (req, res) => {
  res.send('tree-table 模块，根路径请求成功')
})

// 返回菜单表
var menuData = [
  {
    id: 1,
    menuname: '系统管理',
    parentid: null,
    remark: '1',
    menuurl: '/system/managger',
    orderid: 1,
    menuico: 'xxx',
    isfather: true,
    isShow: true,
  },
  {
    id: 2,
    menuname: '菜单管理',
    parentid: 1,
    remark: '备注2',
    menuurl: '/mene/manager',
    orderid: 2,
    menuico: 'xxx',
    isfather: false,
    isShow: true,
  },
  {
    id: 3,
    menuname: '用户管理',
    parentid: 1,
    remark: '备注3',
    menuurl: '/mene/manager',
    orderid: 3,
    menuico: 'xxx',
    isfather: false,
    isShow: true,
  },
  {
    id: 4,
    menuname: '部门管理',
    parentid: 1,
    remark: '备注4',
    menuurl: '/mene/manager',
    orderid: 4,
    menuico: 'xxx',
    isfather: false,
    isShow: true,
  },
  {
    id: 5,
    menuname: '角色管理',
    parentid: 1,
    remark: '备注5',
    menuurl: '/mene/manager',
    orderid: 5,
    menuico: 'xxx',
    isfather: false,
    isShow: true,
  },
]

// 返回菜单信息接口
router.get('/manager-list', (req, res) => {
  res.json(menuData)
})

module.exports = router
